/**
 * Copyright (c) 2015, 2020 itemis AG (http://www.itemis.eu) and others.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 * 
 * SPDX-License-Identifier: EPL-2.0
 */
package org.eclipse.xtend.core.tests.java8.compiler;

import org.eclipse.xtend.core.tests.compiler.XtendCompilerTest;
import org.eclipse.xtend.core.tests.java8.Java8RuntimeInjectorProvider;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.testing.InjectWith;
import org.junit.Test;

/**
 * @author Miro Spoenemann - Initial contribution and API
 */
@InjectWith(Java8RuntimeInjectorProvider.class)
@SuppressWarnings("all")
public class Java8Compiler2Test extends XtendCompilerTest {
  @Test
  public void testStaticMethodInInterface() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("interface Foo {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static def bar() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("\"bar!\"");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public interface Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("static String bar() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return \"bar!\";");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testMultiCatch_02() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("abstract class Foo {");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("abstract def <E extends Exception> void throwsSomething() throws E;");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("def void m() {");
    _builder.newLine();
    _builder.append("     ");
    _builder.append("try {");
    _builder.newLine();
    _builder.append("       ");
    _builder.append("<E1>throwsSomething;");
    _builder.newLine();
    _builder.append("       ");
    _builder.append("<E2>throwsSomething");
    _builder.newLine();
    _builder.append("     ");
    _builder.append("} catch(E1 | E2 e) {");
    _builder.newLine();
    _builder.append("       ");
    _builder.append("e.m");
    _builder.newLine();
    _builder.append("       ");
    _builder.append("e.message");
    _builder.newLine();
    _builder.append("     ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("interface E {");
    _builder.newLine();
    _builder.append("   \t  ");
    _builder.append("def void m()");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("static class E1 extends Exception implements E {");
    _builder.newLine();
    _builder.append("   \t  ");
    _builder.append("override m() {}");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("static class E2 extends Exception implements E {");
    _builder.newLine();
    _builder.append("   \t  ");
    _builder.append("override m() {}");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Exceptions;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public abstract class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("void m();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class E1 extends Exception implements Foo.E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class E2 extends Exception implements Foo.E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public abstract <E extends Exception> void throwsSomething() throws E;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("try {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("try {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("this.<Foo.E1>throwsSomething();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("this.<Foo.E2>throwsSomething();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("} catch (final Throwable _t) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (_t instanceof Foo.E1 || _t instanceof Foo.E2) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final Exception e = (Exception)_t;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("((Foo.E)e).m();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("e.getMessage();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("throw Exceptions.sneakyThrow(_t);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} catch (Throwable _e) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("throw Exceptions.sneakyThrow(_e);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testSwitchWithMultiType_02() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("public class C  {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def m(Object a) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("switch a {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("E1 | E2 case a.message !== null: a.m");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface E {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("def void m()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class E1 extends Exception implements E {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("override m() {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class E2 extends Exception implements E {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("override m() {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("void m();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class E1 extends Exception implements C.E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class E2 extends Exception implements C.E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void m(final Object a) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _matched = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (a instanceof C.E1 || a instanceof C.E2) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("String _message = ((Exception)a).getMessage();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("boolean _tripleNotEquals = (_message != null);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("if (_tripleNotEquals) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("((C.E)a).m();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testSwitchWithMultiType_03() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("public class C  {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def m(Object a) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("switch a {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("E1 | E2 : { val b = a b.message b.m }");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface E {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("def void m()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class E1 extends Exception implements E {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("override m() {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class E2 extends Exception implements E {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("override m() {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("void m();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class E1 extends Exception implements C.E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class E2 extends Exception implements C.E {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void m(final Object a) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _matched = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (a instanceof C.E1 || a instanceof C.E2) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final Exception b = ((Exception)a);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("b.getMessage();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("((C.E)b).m();");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testJava8UnaryOperator() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.append("class Test {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def test(List<Integer> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.replaceAll[it + 1]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.UnaryOperator;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void test(final List<Integer> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final UnaryOperator<Integer> _function = (Integer it) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return Integer.valueOf(((it).intValue() + 1));");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.replaceAll(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testJava8Comparator() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.append("class Test {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def test(List<String> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.sort(java.util.Comparator.comparingInt[String s | s.length]");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append(".thenComparing[String s | s.length])");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Comparator;");
    _builder_1.newLine();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Function;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.ToIntFunction;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void test(final List<String> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final ToIntFunction<String> _function = (String s) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return s.length();");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function<String, Integer> _function_1 = (String s) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return Integer.valueOf(s.length());");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.sort(Comparator.<String>comparingInt(_function).<Integer>thenComparing(_function_1));");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testJava8Predicate() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.append("class Test {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def test(List<Integer> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.removeIf[it < 2]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Predicate;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public boolean test(final List<Integer> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Predicate<Integer> _function = (Integer it) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return ((it).intValue() < 2);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return list.removeIf(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testJava8BinaryOperation() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.append("class Test {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def test(List<Boolean> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.stream.reduce[a, b | a && b]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Optional;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.BinaryOperator;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Optional<Boolean> test(final List<Boolean> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final BinaryOperator<Boolean> _function = (Boolean a, Boolean b) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return Boolean.valueOf(((a).booleanValue() && (b).booleanValue()));");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return list.stream().reduce(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testJava8Consumer() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.append("class Test {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def test(List<String> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.stream.forEach[println(it)]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.InputOutput;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void test(final List<String> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<String> _function = (String it) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("InputOutput.<String>println(it);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.stream().forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testJava8BiFunction() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Map");
    _builder.newLine();
    _builder.append("class Test {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def test(Map<String, Integer> map) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("map.replaceAll[k, v | v + k.length]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Map;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.BiFunction;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void test(final Map<String, Integer> map) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final BiFunction<String, Integer, Integer> _function = (String k, Integer v) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("int _length = k.length();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return Integer.valueOf(((v).intValue() + _length));");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("map.replaceAll(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testDefaultMethodSuperCall01() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Test implements A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override void foo() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("A.super.foo");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void foo() {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test implements A {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("A.super.foo();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testDefaultMethodSuperCall02() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Test implements A, B {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override void foo() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("B.super.foo");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void foo() {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface B {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void foo() {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test implements A, B {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("B.super.foo();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testDefaultMethodSuperCall03() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import test.Consumer");
    _builder.newLine();
    _builder.append("class Test implements Consumer, java.util.function.Consumer<String> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override void accept(String element) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("java.util.function.Consumer.super.andThen(this).accept(\'foo\')");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import test.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Test implements Consumer, java.util.function.Consumer<String> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void accept(final String element) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("java.util.function.Consumer.super.andThen(this).accept(\"foo\");");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testDefaultMethodSuperCall04() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("interface Test extends A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override void foo() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("A.super.foo");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void foo() {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public interface Test extends A {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("default void foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("A.super.foo();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testSelfReference() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class LambdaTest {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def b(A a) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("a.a");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def test() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("b[\'hello\' + b[\'world\' + self.a]]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def String a()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class LambdaTest {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String b(final A a) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return a.a();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String test() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final A _function = () -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final A _function_1 = new A() {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("public String a() {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("String _a = this.a();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("return (\"world\" + _a);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("String _b = this.b(_function_1);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return (\"hello\" + _b);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return this.b(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testClosureNoArgs() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo {");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("val thread = new Thread []");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final Thread thread = new Thread(((Runnable) () -> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}));");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testClosureTwoArgs() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void m(java.util.List<String> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("java.util.Collections.sort(list) [ return 0 ]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Collections;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Comparator;");
    _builder_1.newLine();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void m(final List<String> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Comparator<String> _function = (String $0, String $1) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return 0;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("Collections.<String>sort(list, _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testVoidMethod_02() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def m() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ | System::out.println(\'\') ]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class A {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Procedure0 m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure0 _function = () -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("System.out.println(\"\");");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testVoidMethod_03() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def m() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ | println(\'\') ]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.InputOutput;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class A {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Function0<String> m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function0<String> _function = () -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return InputOutput.<String>println(\"\");");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testThrowablesPropagate_01() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import static extension Throwables.*");
    _builder.newLine();
    _builder.append("import java.net.URI");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class Client {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("val uri = [| new URI(\'\')].propagate [ new IllegalArgumentException(it) ]");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def foo (){");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("uri.toString");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("class Throwables {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def static <T> T propagate(()=>T proc, (Exception)=>Exception handler) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("try {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("proc.apply");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("} catch(Exception e) {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("throw handler.apply(e)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.net.URI;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Exceptions;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Client {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final URI uri = Throwables.<URI>propagate(((Function0<URI>) () -> {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("try {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return new URI(\"\");");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} catch (Throwable _e) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("throw Exceptions.sneakyThrow(_e);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}), ((Function1<Exception, Exception>) (Exception it) -> {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return new IllegalArgumentException(it);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}));");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return this.uri.toString();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testThrowablesPropagate_02() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import static extension Throwables.*");
    _builder.newLine();
    _builder.append("import java.net.URI");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class Client {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("val uri = [| new URI(\'\')].propagate [ new IllegalArgumentException(it) ]");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("class Throwables {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def static <T> T propagate(()=>T proc, (Exception)=>Exception handler) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("try {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("proc.apply");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("} catch(Exception e) {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("throw handler.apply(e)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.net.URI;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Exceptions;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Client {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final URI uri = Throwables.<URI>propagate(((Function0<URI>) () -> {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("try {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return new URI(\"\");");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} catch (Throwable _e) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("throw Exceptions.sneakyThrow(_e);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}), ((Function1<Exception, Exception>) (Exception it) -> {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return new IllegalArgumentException(it);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}));");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testSwitchWithBooleanExpression_3() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def foo(int x) { ");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("switch x {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("case [|1 == x].apply || x == 2: true");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("default: false");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public boolean foo(final int x) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _switchResult = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _matched = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (((((Function0<Boolean>) () -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return Boolean.valueOf((1 == x));");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}).apply()).booleanValue() || (x == 2))) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_switchResult = true;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (!_matched) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_switchResult = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _switchResult;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testSwitchOverNull() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("public class Foo  {");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("def foo() {");
    _builder.newLine();
    _builder.append("        ");
    _builder.append("switch null {");
    _builder.newLine();
    _builder.append("            ");
    _builder.append("case null : [Object it|it]");
    _builder.newLine();
    _builder.append("            ");
    _builder.append("case null : [Integer it|it]");
    _builder.newLine();
    _builder.append("        ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("}    ");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import com.google.common.base.Objects;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Function1<? super Integer, ?> foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("Function1<? super Integer, ?> _switchResult = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Object _switchValue = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _matched = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (Objects.equal(_switchValue, null)) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final Function1<Object, Object> _function = (Object it) -> {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return it;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_switchResult = _function;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (!_matched) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("if (Objects.equal(_switchValue, null)) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("final Function1<Integer, Integer> _function_1 = (Integer it) -> {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("return it;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("_switchResult = _function_1;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _switchResult;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testSwitchWithConstantExpressions_6() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def foo() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("switch x : [|1].apply {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("case 1: true");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public boolean foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _switchResult = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function0<Integer> _function = () -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return Integer.valueOf(1);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("Integer _apply = _function.apply();");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Integer x = _apply;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (x != null) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("switch (x) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("case 1:");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_switchResult = true;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("break;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _switchResult;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testSwitchWithConstantExpressions_7() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def foo() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("switch x : 1 {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("case [|1].apply: true");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import com.google.common.base.Objects;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public boolean foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _switchResult = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final int x = 1;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _matched = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function0<Integer> _function = () -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return Integer.valueOf(1);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("Integer _apply = _function.apply();");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (Objects.equal(x, _apply)) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_switchResult = true;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _switchResult;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testClosureSneakyThrow() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.io.File");
    _builder.newLine();
    _builder.append("import java.io.IOException");
    _builder.newLine();
    _builder.append("import java.util.Collections");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class Foo {");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("def bar() {");
    _builder.newLine();
    _builder.append("       ");
    _builder.append("try {");
    _builder.newLine();
    _builder.append("           ");
    _builder.append("newArrayList(\"file1.ext\").map(f| new File(f).canonicalFile)");
    _builder.newLine();
    _builder.append("       ");
    _builder.append("} catch(IOException o) {");
    _builder.newLine();
    _builder.append("           ");
    _builder.append("Collections::<File>emptyList");
    _builder.newLine();
    _builder.append("       ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.io.File;");
    _builder_1.newLine();
    _builder_1.append("import java.io.IOException;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Collections;");
    _builder_1.newLine();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Exceptions;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.ListExtensions;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public List<File> bar() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("List<File> _xtrycatchfinallyexpression = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("try {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final Function1<String, File> _function = (String f) -> {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("try {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("return new File(f).getCanonicalFile();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("} catch (Throwable _e) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("throw Exceptions.sneakyThrow(_e);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xtrycatchfinallyexpression = ListExtensions.<String, File>map(CollectionLiterals.<String>newArrayList(\"file1.ext\"), _function);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} catch (final Throwable _t) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("if (_t instanceof IOException) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("_xtrycatchfinallyexpression = Collections.<File>emptyList();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("throw Exceptions.sneakyThrow(_t);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xtrycatchfinallyexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testClosureSneakyThrow_02() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("abstract class Foo {");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("def Object getFoo(String x) throws Exception");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("def bar() {");
    _builder.newLine();
    _builder.append("   ");
    _builder.append("<String>newArrayList.toMap[foo]");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Map;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Exceptions;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.IterableExtensions;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public abstract class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public abstract Object getFoo(final String x) throws Exception;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Map<Object, String> bar() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<String, Object> _function = (String it) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("try {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return this.getFoo(it);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("} catch (Throwable _e) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("throw Exceptions.sneakyThrow(_e);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return IterableExtensions.<Object, String>toMap(CollectionLiterals.<String>newArrayList(), _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testNestedClosureWithIt() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class X {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def foo() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val (String)=>String function = [ [String it | it].apply(it) ]");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("function.apply(\'foo\')");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class X {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("String _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final Function1<String, String> _function = (String it) -> {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("final Function1<String, String> _function_1 = (String it_1) -> {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("return it_1;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _function_1.apply(it);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final Function1<? super String, ? extends String> function = _function;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xblockexpression = function.apply(\"foo\");");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testNestedClosureSuperCall() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class X {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def foo() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[| [| super.toString ].apply ].apply");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class X {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String foo() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function0<String> _function = () -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final Function0<String> _function_1 = () -> {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return super.toString();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return _function_1.apply();");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function.apply();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testFindFirstOnIt_01() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class FindFirstOnIt {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> useExtension(Iterable<T> it) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("findFirst [ it !== null ]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.IterableExtensions;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class FindFirstOnIt {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> T useExtension(final Iterable<T> it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<T, Boolean> _function = (T it_1) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return Boolean.valueOf((it_1 != null));");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return IterableExtensions.<T>findFirst(it, _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testAbstractIterator_03() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Iterator");
    _builder.newLine();
    _builder.append("import com.google.common.collect.AbstractIterator");
    _builder.newLine();
    _builder.append("public class Foo  {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> Iterator<T> skipNulls(Iterator<T> iter) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val AbstractIterator<T> result = [|");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("iter.findFirst [ it !== null ] ?: self.endOfData");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("return result");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import com.google.common.collect.AbstractIterator;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Iterator;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.IteratorExtensions;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> Iterator<T> skipNulls(final Iterator<T> iter) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final AbstractIterator<T> _function = new AbstractIterator<T>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("protected T computeNext() {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("T _elvis = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("final Function1<T, Boolean> _function = (T it) -> {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("return Boolean.valueOf((it != null));");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("T _findFirst = IteratorExtensions.<T>findFirst(iter, _function);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (_findFirst != null) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_elvis = _findFirst;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("T _endOfData = this.endOfData();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_elvis = _endOfData;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _elvis;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final AbstractIterator<T> result = _function;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return result;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testAbstractIterator_04() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Iterator");
    _builder.newLine();
    _builder.append("import com.google.common.collect.AbstractIterator");
    _builder.newLine();
    _builder.append("class FindFirstOnIt {");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> Iterator<T> skipNulls(Iterator<T> it) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val AbstractIterator<T> result = [|");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("findFirst [ it != null ] ?: self.endOfData");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("return result");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import com.google.common.base.Objects;");
    _builder_1.newLine();
    _builder_1.append("import com.google.common.collect.AbstractIterator;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Iterator;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.IteratorExtensions;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class FindFirstOnIt {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> Iterator<T> skipNulls(final Iterator<T> it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final AbstractIterator<T> _function = new AbstractIterator<T>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("protected T computeNext() {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("T _elvis = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("final Function1<T, Boolean> _function = (T it_1) -> {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("return Boolean.valueOf((!Objects.equal(it_1, null)));");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("T _findFirst = IteratorExtensions.<T>findFirst(it, _function);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (_findFirst != null) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_elvis = _findFirst;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("T _endOfData = this.endOfData();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_elvis = _endOfData;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _elvis;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final AbstractIterator<T> result = _function;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return result;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testReturnType() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import test.ReturnTypeUsesTypeParameter");
    _builder.newLine();
    _builder.append("class MyClass implements ReturnTypeUsesTypeParameter {");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override <LocalName extends CharSequence> accept(LocalName param) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("null");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import test.ReturnTypeUsesTypeParameter;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class MyClass implements ReturnTypeUsesTypeParameter {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <LocalName extends CharSequence> ReturnTypeUsesTypeParameter.Inner<LocalName> accept(final LocalName param) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return null;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testReturnType_02() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import test.ReturnTypeUsesTypeParameter");
    _builder.newLine();
    _builder.append("class MyClass implements ReturnTypeUsesTypeParameter {");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override <LocalName extends CharSequence> accept(LocalName param) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ if (true) it?.apply(param) ] ");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.append("import test.ReturnTypeUsesTypeParameter;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class MyClass implements ReturnTypeUsesTypeParameter {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <LocalName extends CharSequence> ReturnTypeUsesTypeParameter.Inner<LocalName> accept(final LocalName param) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final ReturnTypeUsesTypeParameter.Inner<LocalName> _function = (Procedure1<? super LocalName> it) -> {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("if (true) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (it!=null) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("it.apply(param);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testReturnType_03() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.LinkedList");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class B extends A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def String client(CharSequence c) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("client(m)");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override m() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("\'\'");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("abstract class A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def CharSequence m() ");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class B extends A {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String client(final CharSequence c) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return this.client(this.m());");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public CharSequence m() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return \"\";");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testInnerTypeImports_1() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo extends types.SomeClassWithNestedInterface {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override types.SomeClassWithNestedInterface.String convert(java.lang.String s) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("return null;");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import types.SomeClassWithNestedInterface;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo extends SomeClassWithNestedInterface {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public SomeClassWithNestedInterface.String convert(final java.lang.String s) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return null;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testRecursiveLambda_01() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("public class Foo  {");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("def void foo((String)=>String func) {");
    _builder.newLine();
    _builder.append("    \t");
    _builder.append("foo[self.apply(it)]");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void foo(final Function1<? super String, ? extends String> func) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<String, String> _function = new Function1<String, String>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public String apply(final String it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return this.apply(it);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.foo(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testRecursiveLambda_02() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("public class Foo  {");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("def void foo(()=>void func) {");
    _builder.newLine();
    _builder.append("    \t");
    _builder.append("foo[|self.apply()]");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void foo(final Procedure0 func) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure0 _function = new Procedure0() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply() {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("this.apply();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.foo(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_01() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo implements ()=>void {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override apply() {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo implements Procedure0 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void apply() {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_02() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("interface Foo extends ()=>void {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override void apply()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public interface Foo extends Procedure0 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("void apply();");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_03() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo implements (String)=>void {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override apply(String value) {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo implements Procedure1<String> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void apply(final String value) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_04() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("interface Foo extends (String)=>void {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override void apply(String value)");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public interface Foo extends Procedure1<String> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("void apply(final String value);");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_05() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo implements ((String)=>void)=>void {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override apply((String)=>void procedure) {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo implements Procedure1<Procedure1<? super String>> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void apply(final Procedure1<? super String> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_06() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("interface Foo extends ((String)=>void)=>void {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override void apply((String)=>void procedure)");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public interface Foo extends Procedure1<Procedure1<? super String>> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("void apply(final Procedure1<? super String> procedure);");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_07() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo implements ()=>String {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override apply() {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo implements Function0<String> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String apply() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return null;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_08() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("interface Foo extends ()=>String {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override String apply()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public interface Foo extends Function0<String> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("String apply();");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_09() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Foo implements ()=>(String)=>void {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override apply() {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo implements Function0<Procedure1<? super String>> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Procedure1<? super String> apply() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return null;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testXFunctionTypeRefAsSuperType_10() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("interface Foo extends ()=>(String)=>void {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override (String)=>void apply();");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function0;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public interface Foo extends Function0<Procedure1<? super String>> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("Procedure1<? super String> apply();");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testSuperCall_01() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("package x class Y extends Object {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override boolean equals(Object p){");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("if (\'foo\' == p)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("return true");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("else");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("super.equals(p) ");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("} ");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("package x;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("import com.google.common.base.Objects;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Y {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public boolean equals(final Object p) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _xifexpression = false;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _equals = Objects.equal(\"foo\", p);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (_equals) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return true;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xifexpression = super.equals(p);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xifexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testSuperCall_03() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("package x");
    _builder.newLine();
    _builder.append("class B extends A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override getThing() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("this.getThing(\'\')");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("\'\'.getThing");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("this.thing");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("\'\'.thing");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("thing");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("getThing(\'\')");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("super.getThing(\'\')");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("super.thing");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("super.getThing");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("super.getThing()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("class A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def String getThing() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("getThing(\'\')");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected String getThing(String s) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("return s");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("package x;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class B extends A {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String getThing() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("String _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.getThing(\"\");");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.getThing(\"\");");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.getThing();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.getThing(\"\");");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.getThing();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.getThing(\"\");");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("super.getThing(\"\");");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("super.getThing();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("super.getThing();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xblockexpression = super.getThing();");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  /**
   * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=395043
   */
  @Test
  @Override
  public void testOverriddenVarArgs() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class B extends A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override foo(String x, String...args) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("return x");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("abstract class A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def String foo(String x, String...args)");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class B extends A {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public String foo(final String x, final String... args) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return x;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testExpectationFromTypeParameter() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Set");
    _builder.newLine();
    _builder.append("import org.eclipse.xtext.common.types.JvmTypeParameter");
    _builder.newLine();
    _builder.append("import org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference");
    _builder.newLine();
    _builder.append("import org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor");
    _builder.newLine();
    _builder.append("import org.eclipse.xtext.xbase.typesystem.references.ITypeReferenceOwner");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C extends TypeParameterSubstitutor<Set<JvmTypeParameter>> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("new(ITypeReferenceOwner owner) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("super(null, owner)");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override substitute(LightweightTypeReference original) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("original.accept(this, newHashSet)");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override protected createVisiting() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("return newHashSet");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Set;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.common.types.JvmTypeParameter;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.typesystem.references.ITypeReferenceOwner;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.typesystem.util.TypeParameterSubstitutor;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C extends TypeParameterSubstitutor<Set<JvmTypeParameter>> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public C(final ITypeReferenceOwner owner) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("super(null, owner);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public LightweightTypeReference substitute(final LightweightTypeReference original) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return original.<Set<JvmTypeParameter>, LightweightTypeReference>accept(this, CollectionLiterals.<JvmTypeParameter>newHashSet());");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Override");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Set<JvmTypeParameter> createVisiting() {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return CollectionLiterals.<JvmTypeParameter>newHashSet();");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Override
  public void testJavaKeywordsUsed() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("package foo;");
    _builder.newLine();
    _builder.newLine();
    _builder.append("public class Foo {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void someMethod(String assert) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val synchronized = newArrayList(\'foo\')");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("for (volatile : synchronized) {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("switch continue : volatile {");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("case continue.length > 2 : synchronized.forEach(break | (break + continue).toString)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("package foo;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("import java.util.ArrayList;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Foo {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void someMethod(final String assert_) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final ArrayList<String> synchronized_ = CollectionLiterals.<String>newArrayList(\"foo\");");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("for (final String volatile_ : synchronized_) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final String continue_ = volatile_;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("boolean _matched = false;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("int _length = continue_.length();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("boolean _greaterThan = (_length > 2);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("if (_greaterThan) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("final Consumer<String> _function = (String break_) -> {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("(break_ + continue_).toString();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("synchronized_.forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }
}
